<template>
  <div class="header">
    <div class="header-left">
      <div class="iconfont back-icon">&#xe604;</div>
    </div>
    <div class="header-input">
      <span class="iconfont">&#xe7d4;</span>
      输入城市/景点/游玩主题</div>
      <router-link to="/City">
        <div class="header-right">
          {{this.city}}
          <span class="iconfont arrow-icon">&#xe64a;</span>
        </div>
      </router-link>
  </div>
</template>

<script>
import {mapState} from 'vuex'
export default {
  name: 'HomeHeader',
  computed: {
    ...mapState(['city'])
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/variables.styl'
  .header
    display: flex
    line-height: $headerHeight
    background: $bgColor
    color: #fff
    .header-left
      width: 32px
      float: left
      .back-icon
        text-align: center
        font-size: 20px
    .header-input
      flex: 1
      background: #fff
      line-height: 32px
      height: 32px
      margin-left: 10px
      margin-top: 6px
      border-radius: 5px
      color: #ccc
      padding-left: 5px
    .header-right
      min-width: 52px
      padding 0 5px
      text-align:center
      color: #fff
      .arrow-icon
        font-size: 12px
        margin-left: -2px
</style>
